﻿@model IEnumerable<PhotoAlbums.Models.Comment>

@{
    ViewBag.Title = "Index";
}

<h2>@ViewBag.Photo.Name</h2>

<p>
    <a href="/Comment/Add?photoId=@ViewBag.Photo.Id">添加评论</a>
</p>
<p>
    <img src="@ViewBag.Photo.PhotoPath" class="img-responsive" />
</p>

@foreach (var item in Model)
{

    <div>
        <div class="panel">
            <div class="panel-heading">
                <span class="left">@Html.DisplayFor(modelItem => item.User.Username)</span>
            </div>
            <div class="panel-body">
                <blockquote>
                    <p>@Html.DisplayFor(modelItem => item.Content)</p>
                </blockquote>
                <div>@Html.DisplayFor(modelItem => item.CreateTime)</div>
                <span class="right">
                    @{
                        if (ViewBag.UserId == item.UserId)
                        {
                            @Html.ActionLink("删除", "Delete", new { id = item.Id });
                        }
                    }
                </span>
            </div>
        </div>
    </div>
}
